<html>
<head><meta charset="utf-8"><title>find_path perf · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html">find_path perf</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220268734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220268734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220268734">(Dec 17 2020 at 16:47)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> curious, have you looked at <code>find_path</code> (the entry point of auto-import) with <code>perf</code> / some other CPU profiler?</p>



<a name="220268795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220268795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220268795">(Dec 17 2020 at 16:48)</a>:</h4>
<p>Nope, not yet</p>



<a name="220268819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220268819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220268819">(Dec 17 2020 at 16:48)</a>:</h4>
<p>Haven't seen it cause perf issues since the ImportMap landed</p>



<a name="220268825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220268825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220268825">(Dec 17 2020 at 16:48)</a>:</h4>
<p>I have a hunch that applying low-level optimizations there, like not allocating all over the place, might pay down the road</p>



<a name="220268854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220268854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220268854">(Dec 17 2020 at 16:48)</a>:</h4>
<p>It's now a part of code completion</p>



<a name="220268886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220268886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220268886">(Dec 17 2020 at 16:49)</a>:</h4>
<p>So it has battery/latency implications now</p>



<a name="220268965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220268965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220268965">(Dec 17 2020 at 16:49)</a>:</h4>
<p>Context: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/6918">https://github.com/rust-analyzer/rust-analyzer/pull/6918</a> and completion taking 100ms loaclly</p>



<a name="220269155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269155">(Dec 17 2020 at 16:51)</a>:</h4>
<p>There's a very noticiable completion threshold at about 100ms, when VS Code stops showing completion widget automatically</p>



<a name="220269212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269212">(Dec 17 2020 at 16:51)</a>:</h4>
<p>ooh, okay, I did notice that</p>



<a name="220269250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269250">(Dec 17 2020 at 16:51)</a>:</h4>
<p>Uhu</p>



<a name="220269255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269255">(Dec 17 2020 at 16:51)</a>:</h4>
<p>It's a bit hard to run perf on something like this</p>



<a name="220269329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269329">(Dec 17 2020 at 16:52)</a>:</h4>
<p>Ideally there'd be a <code>rust-analyzer</code> subcommand that computes completions in a loop or so</p>



<a name="220269333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269333">(Dec 17 2020 at 16:52)</a>:</h4>
<p>Hope one day we'll land <code>if completion.elapsed() &gt; 16ms { std::process::exit(666)}</code> :D</p>



<a name="220269355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269355">(Dec 17 2020 at 16:52)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> bench does something almost like that</p>



<a name="220269377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269377">(Dec 17 2020 at 16:52)</a>:</h4>
<p>it doesn't do a literal loop, because that <em>shoudl</em> be fast, as everything is cached</p>



<a name="220269384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269384">(Dec 17 2020 at 16:52)</a>:</h4>
<p>which is not really true since completions landed</p>



<a name="220269699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269699">(Dec 17 2020 at 16:55)</a>:</h4>
<p>Also, I still <em>badly</em> wish for</p>
<div class="codehilite"><pre><span></span><code>let _perf_guard = enable_perf_profiling();
</code></pre></div>



<a name="220269727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269727">(Dec 17 2020 at 16:55)</a>:</h4>
<p>Which would <em>append</em> over several runs</p>



<a name="220269751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269751">(Dec 17 2020 at 16:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133169">matklad</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/find_path.20perf/near/220269727">said</a>:</p>
<blockquote>
<p>Which would <em>append</em> over several runs</p>
</blockquote>
<p>measureme is working on this</p>



<a name="220269796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269796">(Dec 17 2020 at 16:55)</a>:</h4>
<p>or rustc-perf, sorry</p>



<a name="220269807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269807">(Dec 17 2020 at 16:55)</a>:</h4>
<p>Huh, I should really look into what's there in measureme</p>



<a name="220269813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269813">(Dec 17 2020 at 16:55)</a>:</h4>
<p><a href="https://github.com/rust-lang/rustc-perf/pull/752">https://github.com/rust-lang/rustc-perf/pull/752</a></p>



<a name="220269857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269857">(Dec 17 2020 at 16:56)</a>:</h4>
<p>haven't been able to follow the work</p>



<a name="220269892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269892">(Dec 17 2020 at 16:56)</a>:</h4>
<p>yeah the hardware performance counters was a lot <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> super impressive though</p>



<a name="220269979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220269979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220269979">(Dec 17 2020 at 16:57)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> as you <em>did</em> follow that discussion, quick question can I use hw counters without privilages on a VM?</p>



<a name="220270009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220270009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220270009">(Dec 17 2020 at 16:57)</a>:</h4>
<p>I never actually tried to use it, sorry</p>



<a name="220270014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220270014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220270014">(Dec 17 2020 at 16:57)</a>:</h4>
<p>(X in XY: I want to get instruction counts on CI, but perf-stat doesn't work on actions)</p>



<a name="220270139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find_path%20perf/near/220270139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find_path.20perf.html#220270139">(Dec 17 2020 at 16:58)</a>:</h4>
<p>it might be in the writeup: <a href="https://hackmd.io/sH315lO2RuicY-SEt7ynGA?view">https://hackmd.io/sH315lO2RuicY-SEt7ynGA?view</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>